<h1><%= Media.l_attr(:listing) %></h1>

<table>
  <tr>
    <th>Artist</th>
    <th>Artwork</th>
    <th>File</th>
    <th>Media type</th>
    <th>Caption</th>
  </tr>

<% if @medias.size > 0 %>
  <% for media in @medias %>
   	<%  @media = show_media %>     
	<%= image_tag url_for_file_column(@media, "file", "thumb") %>	
    <tr>   
      <td><%= link_to media.artist.fullname, media.artist %></td>
      <td><%= link_to media.artwork.name, media.artwork %></td>
      <td><%=h media.file %></td>
      <td><%=h media.media_type %></td>
      <td><%=h media.caption %></td>
      <td><%= link_to l(:common, :show), media %></td>
      <td><%= link_to l(:common, :edit), edit_media_path(media) %></td>
      <td><%= link_to l(:common, :destroy), media, :confirm => l(:common, :confirm), :method => :delete %></td>
    </tr>
  <% end %>
<% else %>
<tr><td colspan="5">No media yet!</td></tr>
<% end %>
</table>

<br />

<% link_to 'New media', new_media_path %>
